package kr.hkit.powerjava.chapter21.work;

// Programming02

class MyException extends Exception {

	public MyException(String message) {
		super(message);

	}

}

public class MyExceptionTest {
	public static void checkNegative(int number) throws MyException {
		if (number<0){
			throw new MyException("음수는안됩니다.");
		}
		System.out.println("다행히 음수는아니네?");
	}
	public static void main(String[] args) {
		try{
			checkNegative(1);
			checkNegative(-1);
			
		}catch (MyException ex){
			ex.printStackTrace();
		}
	}

}
